﻿namespace Vin.Tool.Core.AssertCategory;

public static partial class Extension
{
    public static bool IsNullOrEmpty(this string? value)
    {
        value = value?.Trim();
        return string.IsNullOrEmpty(value);
    }

    public static bool IsNull(this object? value) => value is null;

    public static bool IsNotNullOrEmpty(this string? value)
    {
        value = value?.Trim();
        return !string.IsNullOrEmpty(value);
    }

    public static bool IsNotNull(this object? value) => value is not null;

    public static bool IsNullOrWhiteSpace(this string? value) => string.IsNullOrWhiteSpace(value);

    public static bool IsNotNullOrWhiteSpace(this string? value) => !string.IsNullOrWhiteSpace(value);
}